package com.mxsoft;

import java.lang.instrument.ClassFileTransformer;
import java.lang.instrument.Instrumentation;

public class PerformanceAgent {
    static private Instrumentation instrumentation = null;

    public static void premain(String agentArgs, Instrumentation instrumentation) {
        System.out.println("PerformanceAgent.premain() was called.");

        PerformanceAgent.instrumentation = instrumentation;

        ClassFileTransformer classFileTransformer = new PerformanceTransformer();

        System.out.println("Adding a PerformanceTransformer instance to the JVM.");

        PerformanceAgent.instrumentation.addTransformer(classFileTransformer);
    }
}
